﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Wap/Shop/ShopSite.Master" CodeBehind="BindAccount.aspx.cs" Inherits="ZLCMS.Web.Wap.Member.BindAccount" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>绑定帐号</title>
    <link rel="stylesheet" href="/wap/lib/validator-0.7.0/css/jquery.validator.css" />
    <script type="text/javascript" src="/wap/lib/validator-0.7.0/jquery.validator.js"></script>
    <script type="text/javascript" src="/wap/lib/validator-0.7.0/local/zh_CN.js"></script>
    <script src="../lib/jquery/jquery.cookie.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="pages" runat="server">

<div data-role="page" id="mypage">

	<div data-role="header">
	</div><!-- /header -->
    
 	<div role="main" class="ui-content">
      <div id="login">
        <form id="Form1" data-ajax="false">
            	<div class="loginLIST">
                	<div class="left"><img src="/wap/shop/images/icon_phone.png"></div>
                    <div class="right"><input type="text" name="code" placeholder="手机/邮箱/帐号" data-rule="required"/></div>
                </div>
                <div class="loginLIST">
                	<div class="left"><img src="/wap/shop/images/icon_password.png"></div>
                    <div class="right"><input name="password" type="password" placeholder="密码" data-rule="密码: required;"/></div>
                </div>
                <div class="button">
                    <a href="javascript:void(0);" id="tb_commit" data-role="button" data-theme="o" data-shadow="false" onclick="bindAccount($('#Form1'))">绑 定</a>           	
                </div>
                    <div class="text">
                	    <a href="Login.aspx?goto=<%=Server.UrlEncode(Request["goto"]) %>" data-ajax="false">返回登录页面</a>
                    </div>
            </form> 
      </div>
	</div><!-- /content -->
    <div data-role="footer" class="footer" data-position="fixed">
          
    </div>
    <!--footer end-->
</div><!-- /page -->
<script type="text/javascript">
var oauthData = <%=Request["data"] %>;
var oauthKind = '<%=Request["kind"] %>';
</script>

 <script type="text/javascript">
     function bindAccount(ui) {
         ui.trigger("validate");
         if (ui.isValid()) {
             ui.executeCommand({ successCallBack: function (result, totalCount) {
                 showTips("绑定成功！", 500, function () {
                     location.href = 'LoginSuccess.aspx?token=' + result.Token + '&goto=<%=Server.UrlEncode(Request["goto"]) %>';
                 });
             }
             }, 'Member.BindAccount', {
                 OAuthKind: oauthKind,
                 OAuthData: oauthData,
                 Code: $('input[name=code]').val(), 
                 Password: $('input[name=password]').val()
             });
         }
     }

 </script>



</asp:Content>